package com.shujia.flink.tf;

import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

public class Demo02Map {
    public static void main(String[] args) throws Exception {
        /*
         * map算子：传入一行返回一行
         */
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

        DataStreamSource<String> socketDS = env.socketTextStream("master", 8888);

        // 将过来的数据转换成大写
        socketDS.map(word->word.toUpperCase()).print();
        socketDS.map(String::toUpperCase).print();

        env.execute();
    }
}
